/* 基础样式 */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #4cc9f0;
  --success-color: #4cc9f0;
  --danger-color: #f72585;
  --background-color: #f8f9fa;
  --card-color: #ffffff;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    /*background-color: #f5f5f5;*/
    /*color: #333;*/
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

header {
    /*background-color: #2c3e50;*/
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    margin-left: 20px;
}

.user-controls button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.user-controls button:hover {
    background-color: #2980b9;
}

.file-operations {
    padding: 15px;
    background-color: white;
    border-bottom: 1px solid #ddd;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.operation-buttons {
    display: flex;
    width: 100%;
    margin: 0 auto;
    gap: 0;
}

/* 按钮样式定义 - 使用CSS变量确保主题一致性 */
.file-operations button {
    flex: 1;
    padding: 12px 10px;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 题目讲解按钮 */
.btn-success {
    background-color: rgb(5, 196, 196);
    border-radius: 6px 0 0 6px;
}

.btn-success:hover {
    background-color: rgb(4, 147, 147);
}

/* 试题生成按钮 */
.btn-accent {
    background-color: rgb(3, 125, 255);
}

.btn-accent:hover {
    background-color: rgb(2, 94, 192);
}

/* 上传文件按钮 */
.btn-secondary {
    background-color: rgb(2, 38, 169);
}

.btn-secondary:hover {
    background-color: rgb(1, 28, 127);
}

/* 新建文件夹按钮 */
.btn-primary {
    background-color: rgb(102, 39, 249);
    border-radius: 0 6px 6px 0;
}

.btn-primary:hover {
    background-color: rgb(77, 29, 187);
}

.breadcrumb {
    padding: 10px 15px;
    background-color: #ecf0f1;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    margin: 0 20px;
    border-radius: 8px 8px 0 0;
}

/* 文件列表样式 - Windows资源管理器风格 */
.file-list {
    background-color: white;
    margin: 0 20px 20px 20px;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* 列表标题行 */
.file-header {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
    color: #333;
}

/* 文件项 */
.file-item {
    display: flex;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    padding: 0;
    background-color: white;
    box-shadow: none;
    border-radius: 0;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.file-item:hover {
    background-color: #f0f7ff;
    transform: none;
    box-shadow: none;
}

/* 文件列 */
.file-column {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 列宽设置 */
.name-column {
    flex: 3;
    min-width: 200px;
    gap: 8px;
}

.type-column {
    flex: 1;
    min-width: 80px;
}

.size-column {
    flex: 0.8;
    min-width: 60px;
    text-align: right;
}

.modified-column {
    flex: 1.5;
    min-width: 120px;
}

.actions-column {
    flex: 1;
    min-width: 100px;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

/* 文件图标 */
.file-icon {
    font-size: 18px;
}

/* 文件操作按钮 */
.file-column button {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

/* 文件内容查看模态框样式 */
.file-content {
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 返回上一层按钮样式 */
.back-button {
    background-color: var(--primary-color);
    color: rgb(255, 255, 255);
    border: none;
    padding: 8px 15px;
    margin-right: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: var(--secondary-color); /* 悬停时使用深色 */
}

.file-column button:hover {
    background-color: #e3f2fd;
    text-decoration: none;
}

.file-actions button {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    margin-left: 10px;
}

.file-actions button:hover {
    text-decoration: underline;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    /* max-height: 70vh;  视口高度的 70% */
    overflow-y: auto;
    padding-right: 10px;  /* 防止滚动条挡住文字 */
}

/* 通用模态框内容样式 */
.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 6px;
    position: relative;
    width: 50%;
    max-width: 500px;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/*整个模态框（占满整个屏幕的，不过分为可见区域和不可见区域，可见区域是模态框的内容区域，不可见区域是模态框的背景区域）*/
.typeModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

/*模态框的内容区域*/
.typeModal .modal-content {
    width: 300px;
    text-align: center;
    margin: 0;
}
/*选择按钮*/
#fileTypeSelect{
    width:70%;
    margin:5px auto 20px auto; /* 上边距减小，下边距增大使离按钮更远 */
}

/* 模态框中的按钮容器div */
.typeModal .modal-content div:last-child {
    display: flex;
    justify-content: center;
    gap: 10px ;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* 模态框按钮样式confirm和cancel*/
.typeModal button {
    padding: 4px 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 5px;
}

#confirmTypeBtn {
    background-color: var(--success-color);
    color: white;
}

#confirmTypeBtn:hover {
    background-color: #3daac9;
}

#cancelTypeBtn {
    background-color: #6c757d;
    color: white;
}

#cancelTypeBtn:hover {
    background-color: #5a6268;
}